package flymoke.generic.covariant;

import java.util.ArrayList;
import java.util.List;

import flymoke.generic.inter.Apple;
import flymoke.generic.inter.Fruit;

public class GeneraicWriting {
	static <T> void writingWild(List<T> list,T item){
		list.add(item);
	}
	
	static List<Apple> apple = new ArrayList<Apple>();
	static List<Fruit> fruit = new ArrayList<Fruit>();
	
	static void f1(){
		writingWild(apple,new Apple());
		writingWild(fruit,new Apple());
	} 
	
	static <T> void writingWildCard(List<? super T> list,T item){
		list.add(item);
	}
	
	static void f2(){
		writingWildCard(apple,new Apple());
		writingWildCard(fruit,new Apple());
	}
	
	public static void main(String[] args) {
		f1();
		f2();
	}
}
